#ifndef MAINWINDOW_H
#define MAINWINDOW_H


#include <campaign.h>
#include <dtwentymodel.h>


#include <QMainWindow>
#include <QPointer>
#include <QPersistentModelIndex>


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();


protected:

    bool closeCampaign(bool allowCancel = true);

    virtual void closeEvent(QCloseEvent *e);


protected slots:

    void initialize();

    void setViewRootIndex(int metaTypeId);


private slots:

    void on_actionNew_triggered();

    void on_actionOpen_triggered();

    void on_actionSave_As_triggered();

    void on_actionSave_triggered();

    void on_actionQuit_triggered();


    void on_lineEditCampaignName_editingFinished();


    void on_actionSkills_triggered();

    void on_actionFeats_triggered();

    void on_actionSpecials_triggered();

    void on_actionCharacter_Classes_triggered();

    void on_actionDelete_triggered();

    void on_actionNew_Item_triggered();

    void on_actionEdit_triggered();

private:

    Ui::MainWindow *ui;

    Campaign* m_campaign;
    DTwentyModel* m_model;

    QString m_fileName;

    QMap<QPersistentModelIndex, QPointer<QDialog> > m_editorDialogs;

};

#endif // MAINWINDOW_H
